<%  var currenturl = window.location; 
	if (app_settings.length > 0 ) { %>
<div class="well-sm">
	<h3><%- i18next.t(app_settings[0].app_name) %> - <%- i18next.t('Settings') %></h3>
</div>
<%  if(!_.isEmpty(app_settings[0].settings_description)){ %>
<div class="alert alert-info list-group-item-text text-wrap"><%= i18next.t(app_settings[0].settings_description) %></div>
<% } %>
<div class="well-sm"></div>
<% if(!_.isUndefined(currenturl.hash) && (currenturl.hash !== '#/apps/r_multiple_ldap_login')){ %>
<form class="js-app-setting-form" role="form" id="js-app-setting-form">
<% 
var folder = '';
_.each(app_settings, function(app_setting) { 
	folder = app_setting.folder;
	if(_.isUndefined(app_setting.is_hide) && (app_setting.is_hide != 'true')){
%>
	<div class="form-group col-xs-12">
			  <label class="col-sm-2  control-label col-xs-12"><%- i18next.t(app_setting.label ) %></label>
			  <div class=" col-sm-7  col-xs-12">
				<% if(!_.isUndefined(app_setting.is_encrypted) && (app_setting.is_encrypted === true)){ %>
					<input type="text" value="" class="form-control" name="<%- app_setting.name %>" id="<%- app_setting.name %>">
				<% } else if (!_.isUndefined(app_setting.type) && !_.isEmpty(app_setting.type) && app_setting.type !== null && app_setting.type === 'dropdown'){ 
					var options = app_setting.options.split(','); %>
					<select class="form-control cur" name="<%- app_setting.name %>">
						<% _.each(options, function(option) { %> 
							<option <% if(app_setting.value === option){ %>selected<% } %> value="<%- option %>"><%- option %></option>
						<% }); %>
					</select> 
				<% } else { %>
					<input type="text" value="<%- app_setting.value %>" class="form-control" name="<%- app_setting.name %>" id="<%- app_setting.name %>">					
				<% } %>
				<div><span class="help-block text-wrap"><%= app_setting.info %></span></div>
			  </div>
	</div>
<% } %>
<% }); 
} %>
<input type="hidden" value="<%- folder %>" name="folder" id="folder">
  <div class="form-group">
	<label for="submit" class="sr-only  col-sm-4  control-label col-xs-12"><%- i18next.t('Submit') %></label>
	<div class="col-sm-offset-2 col-sm-10 col-xs-12">
		<input type="submit" value="<%- i18next.t('Update') %>" id="submit" class="btn btn-primary">
		<%  var currenturl = window.location; %>
		<% if(!_.isUndefined(currenturl.hash) && (currenturl.hash === '#/apps/r_ldap_login')){ %>
	   
			<input type="button" value="<%- i18next.t('Test Connection') %>" class="btn btn-default js-test-connection">
			<button type="button" id="importUsersSubmit" class="js-import-users btn btn-default"><%- i18next.t('Import users') %></button>
			<span class="clearfix hide" id="js-loader-img"><span class="cssloader"></span></span>
		<% } %>
		<%  
			if(!_.isUndefined(currenturl.hash) && (currenturl.hash === '#/apps/r_sparkpost')){
	   %>
	   <input type="button" value="<%- i18next.t('Test Connection') %>" class="btn btn-default js-spark-testmail">
		<% } %>
	</div>
  </div>
</form>
<% } %>	
<% if(!_.isUndefined(currenturl.hash) && (currenturl.hash === '#/apps/r_multiple_ldap_login')){ %>
	<%
	var ldap_servers = app_settings.filter(function(model) {
		return model.name === 'R_MLDAP_SERVERS';
	});
%>
	<form class="js-ldapapp-app-setting-form" role="form" id="js-ldapapp-setting-form">
		<div class="form-group col-xs-12">
			<label class="col-sm-2  control-label col-xs-12"><%- i18next.t(ldap_servers[0].label ) %></label>
			<div class=" col-sm-7  col-xs-12">
				  <input type="text" name="<%- ldap_servers[0].name %>" value="<%- ldap_servers[0].value %>" class="form-control js-ldap_servers_input" >					
			  <div><span class="help-block text-wrap"><%- ldap_servers[0].info %></span></div>
			</div>
		  </div>
		  <div class="form-group col-xs-12">
			<label for="inputSetting" class="col-sm-2  control-label col-xs-12"><%- i18next.t('Configure LDAP Server') %></label>
			<div class="col-sm-7  col-xs-12">
				<select name="<%- i18next.t('configure_ldap_server') %>" id="configure_ldap_server" class="form-control js-configure-LDAP-server">
						<option value="">Please Select</option>
					<% if(!_.isUndefined(ldap_servers[0].value) && !_.isEmpty(ldap_servers[0].value)){ 
						var options = ldap_servers[0].value.split(',');
					_.each(options, function(v, k) { %>
						<option value="<%- v %>"><%- v %></option>
					<% });} %>
				</select>
				<div><span class="help-block"><%- i18next.t('Configure your LDAP server by choosing the server') %></span></div>
			</div>
		</div>
		<div class="well-sm"></div>
		<div class="ldap_attributes_content"></div>
		<div class="form-group js-ldap-submit hide">
				<input type="hidden" value="r_multiple_ldap_login" name="folder" id="folder">
				<label for="submit" class="sr-only  col-sm-4  control-label col-xs-12"><%- i18next.t('Submit') %></label>
				<div class="col-sm-offset-2 col-sm-10 col-xs-12">
					<input type="submit" value="<%- i18next.t('Update') %>" id="submit" class="btn btn-primary">	 
						<input type="button" value="<%- i18next.t('Test Connection') %>" class="btn btn-default js-test-connection">
						<button type="button" id="importUsersSubmit" class="js-import-users btn btn-default"><%- i18next.t('Import users') %></button>
						<span class="clearfix hide" id="js-loader-img"><span class="cssloader"></span></span>
				</div>
				</div>
	</form>
<% } %>		